package com.yunfeisoft.business.model;

import com.yunfeisoft.base.model.WorkflowInstance;
import com.yunfeisoft.common.base.BaseModel;
import com.yunfeisoft.common.sql.record.TransientField;
import com.yunfeisoft.common.utils.DateUtils;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * ClassName: RegularApproval
 * Description: 员工转正审批表
 *
 * @Author: Jackie liu
 * Date: 2020-05-14
 */
@Entity
@Table(name = "TT_REGULAR_APPROVAL")
public class RegularApproval extends BaseModel implements Serializable {

    /**
     * Field serialVersionUID: 序列号
     */
    private static final long serialVersionUID = 1L;

    /**
     * 流程定义id
     */
    @Column
    private String workflowDefineId;

    /**
     * 姓名
     */
    @Column
    private String name;

    /**
     * 岗位
     */
    @Column
    private String position;

    /**
     * 部门
     */
    @Column
    private String dept;

    /**
     * 到岗日期
     */
    @Column
    private Date reportDate;

    /**
     * 考评分数
     */
    @Column
    private Integer grade;

    /**
     * 试用期满时间
     */
    @Column
    private Date trialEndDate;

    /**
     * 备注
     */
    @Column
    private String remark;

    @TransientField
    private Integer validStatus;
    @TransientField
    private String createName;
    //下一节点处理人
    private String nextStepUserId;

    public String getReportDateStr() {
        if (reportDate != null) {
            return DateUtils.dateToString(reportDate);
        }
        return null;
    }

    public String getTrialEndDateStr() {
        if (trialEndDate != null) {
            return DateUtils.dateToString(trialEndDate);
        }
        return null;
    }

    public String getValidStatusStr() {
        return WorkflowInstance.WorkflowInstanceStatusEnum.valueOf(validStatus);
    }

    public String getWorkflowDefineId() {
        return workflowDefineId;
    }

    public void setWorkflowDefineId(String workflowDefineId) {
        this.workflowDefineId = workflowDefineId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public String getDept() {
        return dept;
    }

    public void setDept(String dept) {
        this.dept = dept;
    }

    public Date getReportDate() {
        return reportDate;
    }

    public void setReportDate(Date reportDate) {
        this.reportDate = reportDate;
    }

    public Integer getGrade() {
        return grade;
    }

    public void setGrade(Integer grade) {
        this.grade = grade;
    }

    public Date getTrialEndDate() {
        return trialEndDate;
    }

    public void setTrialEndDate(Date trialEndDate) {
        this.trialEndDate = trialEndDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Integer getValidStatus() {
        return validStatus;
    }

    public void setValidStatus(Integer validStatus) {
        this.validStatus = validStatus;
    }

    public String getCreateName() {
        return createName;
    }

    public void setCreateName(String createName) {
        this.createName = createName;
    }

    public String getNextStepUserId() {
        return nextStepUserId;
    }

    public void setNextStepUserId(String nextStepUserId) {
        this.nextStepUserId = nextStepUserId;
    }
}